package com.peixunp.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.peixunp.service.RemarkService;

import finaler.util.Page;
import finaler.util.PageList;

@Controller
@RequestMapping("remark")
public class RemarkController {

	@Autowired
	private RemarkService remarkService;

	@RequestMapping( value="/good.html" )
	public String good(HttpServletRequest request) throws Exception {
		Page page = new Page(request);
		page.setRange(10);
		page.putParameter("coinWhere", "coin > 60");
		PageList remarkList = remarkService.getGoodOrBadList(page);
		request.setAttribute("remarkList", remarkList);
		return "/remark/list";
	}

	@RequestMapping( value="/bad.html" )
	public String bad(HttpServletRequest request) throws Exception {
		Page page = new Page(request);
		page.setRange(10);
		page.putParameter("coinWhere", "coin < 60");
		PageList remarkList = remarkService.getGoodOrBadList(page);
		request.setAttribute("remarkList", remarkList);
		return "/remark/list";
	}

}
